import numpy as np
import pandas as pd
df4 = pd.DataFrame(np.arange(12).reshape(4,3),index=list('abcd'),columns=list('xyz'))
df4.loc[1:3,0:2] = np.nan#设置几个nan值
df4.iloc[2,2] = np.nan


df4.dropna(how='all')
df4.dropna(thresh=2)